package com.dtsz.m2.ui.adapter;

import android.content.Context;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.dtsz.m2.R;
import com.dtsz.m2.ui.model.Ecology;
import com.dtsz.m2.volley.commonadapter.BaseCommonAdapter;
import com.dtsz.m2.volley.commonadapter.ViewHolder;

import java.util.List;

public class EcologyAdatper extends BaseCommonAdapter {
    private Context mContent;

    public EcologyAdatper(Context context, List data, int layoutItemId) {
        super(context, data, layoutItemId);
        mContent = context;
    }


    @Override
    public void convertView(ViewHolder holder, Object o) {
        Ecology ecology = (Ecology) o;
        Glide.with(mContent).load(ecology.getMapImageUrl()).into((ImageView) holder.getChildView(R.id.iv_image));
        holder.setTextView(R.id.tv_title, ecology.getCountry());
    }
}
